#!/usr/bin/perl
use strict;
use Chart::Graph::Gnuplot qw(gnuplot);
   my %options = (
                   'title' => 'plot functions example',
                   'output file' => 'temp.png',
                 );

   my $data = [{ 'title' => 'data 1',
                 'style' => 'lines',
                 'type' => 'matrix',
               },
               [
                 [0,10],
                 [3,30],
                 [6,0],
                 [9,-10],
                 [12,-0],
               ]
              ];

   my $fnc1 = [{ 'title' => 'function 1',
                 'style' => 'lines',
                 'type' => 'function',
               },
               '10*sin(x)+2*cos(1.1 * x)+.5*tan(x)'
              ];

   my $fnc2 = [{ 'title' => 'function 2',
                 'style' => 'lines',
                 'type' => 'function',
               },
              '1+2'
              ];

gnuplot(\%options, $data, $fnc1, $fnc2);

